package com.zjw.zy.coreui.dialog;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.zjw.zy.smi.JustWithIt2;

import java.util.List;

public class TwoListDialog<VALUE1, VALUE2> extends BaseListDialog<VALUE1, VALUE2, VALUE1> {

    protected TwoListDialog(@NonNull Context context) {
        super(context);
    }

    protected TwoListDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected TwoListDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    public static <VALUE1, VALUE2> TwoListDialog<VALUE1, VALUE2> build(Context context) {
        return new TwoListDialog<>(context);
    }

    @Override
    public void bindData(@NonNull List<String> keys, @NonNull List<VALUE1> values,
                         @NonNull List<String> keys2, @NonNull List<VALUE2> values2) {
        super.bindData(keys, values, keys2, values2);
    }

    public TwoListDialog<VALUE1, VALUE2> select1Value(VALUE1 value) {
        super.select1Value(value);
        return this;
    }

    public TwoListDialog<VALUE1, VALUE2> select2Value(VALUE2 value) {
        super.select2Value(value);
        return this;
    }

    @Override
    public TwoListDialog<VALUE1, VALUE2> title(@NonNull String title) {
        super.title(title);
        return this;
    }

    public TwoListDialog<VALUE1, VALUE2> bindNegativeCallback(JustWithIt2<VALUE1, VALUE2> call) {
        BaseListDialog<VALUE1, VALUE2, VALUE1> callback = super.bindNegativeCallback((obj1, obj2, obj3) -> call.onWith(obj1, obj2));
        return this;
    }

    public TwoListDialog<VALUE1, VALUE2> bindPositiveCallback(JustWithIt2<VALUE1, VALUE2> call) {
        BaseListDialog<VALUE1, VALUE2, VALUE1> callback = super.bindPositiveCallback((obj1, obj2, obj3) -> call.onWith(obj1, obj2));
        return this;
    }
}
